import { getAction, deleteAction, putAction, postAction, downFilePost } from '@/api/manage'

const serviceName = '/flow-server'
/*-----------流程-----------*/
//获取流程配置列表
const getProcessList = (params) => getAction(`${serviceName}/countersign-process-config-info/getProcessList`, params)
//新增流程配置信息
const addProcess = (params) => postAction(`${serviceName}/countersign-process-config-info/add`, params)
//获取流程配置详情
const getDetail = (id) => getAction(`${serviceName}/countersign-process-config-info/getEditDetail/${id}`)
//编辑流程配置信息
const updateProcess = (params) => putAction(`${serviceName}/countersign-process-config-info/update`, params)
//停用、启用操作
const operateProcess = (params) => putAction(`${serviceName}/countersign-process-config-info/operate`, params)
//删除流程配置信息
const deleteProcess = (id) => deleteAction(`${serviceName}/countersign-process-config-info/delete/${id}`)

/*-----------审批-----------*/
//审批列表（通用）
const getProcessInfoList = (params) => getAction(`${serviceName}/countersign-process-approval-info/getProcessInfoList`, params)
//查询流程详情
const getProcessDetail = (id) => getAction(`${serviceName}/countersign-process-approval-info/getProcessNodeList/${id}`)
//审批
const approval = (params) => putAction(`${serviceName}/countersign-process-approval-info/approval`, params)
//待办数量
const getCSWaitNum = (params) => getAction(`${serviceName}/countersign-process-approval-info/getWaitNum`, params)
//催一下
const getUrge = (params) => getAction(`${serviceName}/countersign-process-approval-info/urge`, params)

export {
  getProcessList,
  addProcess,
  getDetail,
  updateProcess,
  operateProcess,
  deleteProcess,

  getProcessInfoList,
  getProcessDetail,
  approval,
  getCSWaitNum,
  getUrge
}
